package com.googlecode.transmutant.spring;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import com.googlecode.transmutant.Stepper 
import org.junit.Test;
import org.junit.runner.RunWith 
import org.springframework.beans.factory.annotation.Autowired 
import org.springframework.context.ApplicationContext 
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration 
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner 

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("capture.xml")
public class SpringStepperCaptureOutsTest {

	@Autowired
	ApplicationContext applicationContext
	
	@Test
	public void testCreateSteps() throws Exception {
		SpringStepper stepper = applicationContext.getBean("stepper")
		Captures captures = stepper.getCaptures()
		assert captures.getCapturedValue("helloWorldAgain") == null
		assert captures.getCapturedValue("helloWorld").equals("Hello World!")
		assert captures.getCapturedValue("helloWorld2").equals("Hello World!")
	}
}
